winthierfandomcom-20200213-history
Lag
Lag is one of the most common complaints posed by players on Winthier, other Minecraft servers or online games in general. What many people are not aware of is that the term comprises several different things, all of which mean a gameplay experience compromised by corrupted timings in the simulation. The following is a discussion of three different types of lag, including what causes them and how to fight them, respectively. What you shouldn't do is complain by typing "Lag" in global chat. It doesn't help anyone or anything and doesn't contain any useful information, as the article below will highlight. If there is any server lag going on, which rarely happens, the admins are usually the first who learn about it and are already on the case. If it's network or client lag, then there is nothing anyone on the server can do to help you. If you are looking for help with lag, continue reading. Network Latency This is probably the most common type of lag. Minecraft is a game which is particularly susceptible to network related latency because of its dynamic terrain, which requires many big packages to be sent over a thin network line. Network Latency is usually noticeable by a delayed reaction to your actions as a player on our server. When you break a block, it only drops after a moment, enemies seem to hit you from a distance away, and your chat messages show up way after you have sent them. Information about dozens of players, hundreds of entities and thousands of blocks have to be sent from the location of our server to your home or, in smaller doses, the other way around. On their way, these information, called packets, are handed over between many intermediate computers, hence travel over many different types of network connections, until they reach the other end. As you may reckon, the speed of transmission depends on many factors, most of which neither you nor we can control in any way. If any of the nodes the packets end up traversing has any sort of problem, your connection to Winthier will suffer and the lag will increase. These issues are not only hard to control, they are also inconsistent. Everything can fine one day but totally off the very next, maybe because one of the involved networks is performing maintenance or is experiencing technical difficulties. There are however cases where you can actively decrease network latency and improve your connection. Causes Limited Bandwitdh This will affect you especially if you are using a WiFi internet connection. The bottleneck of any network transaction is usually the way your computer is hooked up to the internet. WiFi is usually not ideal, mobile broadband even less so. Network strain on your computer If you make heavy use of your network bandwidth while playing Minecraft, less of what your internet connection can handle in total can be used by Minecraft. The usual suspects are downloads in the background, a Youtube video you watch in another window, or your torrent client leeching and seeding while you play. It doesn't even have to be on your very computer, but anyone in your household. Network strain on the server This has only happened once, but it is perfectly possible that the server can't handle the network load of sending all the packets to all the connected clients, which is what most of the bandwidth is used for. This could be caused by a malicious attacker trying to harm us, for whatever reason. Fear not, because whatever anyone can do to us will get them into big trouble and will most likely affect us no longer than a few hours. What to do Testing Before doing anything, you should test if it is really network lag you are experiencing. You can do so by typing the /getping command. It will give you a number meaning the milliseconds network packets take to travel between the server and you. The lower it is, the better. A decent value is 250 or below, and anything under 100 is excellent. Close applications As stated above, other applications on your computer can hog your available bandwidth. Try closing or at least reducing the power of your web browser, torrent client, audio and video conferencing software, streaming applications, and even some video and music players. Improve your connection If you have the option to use a wired connection rather than WiFi, use it. In almost any case, it will give you more bandwidth. If you have to use WiFi, try to get closer to the station, usually your router. Walls and floors between your computer and the station decrease can bandwidth greatly. Client Overload The second most common type of lag is an overloaded client. When the Minecraft application on your computer can't do all the calculations necessary to play the game fast enough, you experience lag. Almost all of the time, this is connected with graphics. Client lag is usually experienced by stuttering graphics caused by a lowered FPS. When you move your mouse to make your player look somewhere, but the screen moves very slowly, you have an issue with your computer. What happens is that a picture has to be constructed out of numbers and mathematical formulas, dozens of times every second to result in the illusion of animation. The quality of your gameplay experience depends on how often the game manages to draw these pictures. Causes Other applications running Your CPU and memory are limited resources, just like network bandwidth. The more other applications run besides Minecraft, the less of them can be used for playing the game. As soon as there's not enough left to run the game at top performance, your gameplay experience will suffer. Poor graphics adapter The most performance critical part of almost every computer game are the graphics. If your computer has problems displaying 3D graphics, it can have issues with Minecraft as well. While the game looks simple, its graphics display is surprisingly performance hungry. High Video Settings The Minecraft client has options to configure the display quality. It should be configured according to the capabilities of your computer. If they are too high, you computer will be overwhelmed and start lagging. Too many entities The complexity of the minecraft terrain is easy to control. Most of the time, there are the same amounts of blocks in your surroundings. What is nearly uncontrollable are entities, such as animals, monsters, items on the ground and item frames. These take some extra effort on your client's side to simulate and render. Then there are blocks that are not shaped like your average cubic meter block, slab or stair, such as chests and signs. They also take an extra effort to be rendered. If you are in an area with many of these, like the market or crazy animal farms, your client will suffer. What to do Testing While in the game, hit F3. A bunch of statistics will appear on your screen. What you are interested in, are the FPS (frames per second). In the top left corner of your screen, it will display the Minecraft version number, followed by the FPS. The higher this number is, the better. A decent FPS is 20 or more, anything above 60 is excellent. Turn down graphics settings Minecraft allows to configure the display quality. Choosing a lower quality will result in less impressive visuals, but better performance. Hit ESC, then click "Options..." and "Video Settings..." and try to change settings from "Fancy" to "Fast". What will make the biggest difference is lowering the Render Distance. Install OptiFine An extension to the previous measurement, should it not help by itself, is the installation of the OptiFine mod. With this mod installed, Minecraft makes better use of your CPU and your graphics card and allows more configurations to the graphics display. Make sure to choose the right version and follow the installation instructions closely. Close other applications Turning off anything that's running in the background will leave more resources to your Minecraft client. Consider closing your web browser, video applications and other games. Server Overload Server lag works conceptually the same way client lag does. Whenever the Minecraft server software is asking more than the machine can handle, the game will not run as smoothly as it should. The effects are similar to network lag, which is probably why they are so often mistaken for one another. Like with latency issues, effects of your actions are delayed. More than that though, does time on the whole server progress slower. You will notice that celestial bodies (sun, moon and stars) move slower and even stutter, and for example auctions will take longer than they should. It is easy to explain and for us even easier to measure. Minecraft defines a time unit of one tick, which is one twentieth of a second. Each tick, every single entity (monsters, animals, items on the ground, etc.) will be checked for movement, collisions, termination and much more. Every tick, mobs are spawned, plants grow, leaves decay. Every tick, players may have broken blocks, moved around, picked up items or interacted with other entities or each other. When the system is overloaded, it can no longer simulate 20 ticks per second, so everything will progress a bit slower. It is downright trivial for me to measure how many ticks the system manages to simulate at any given time. All I have to do is enter the appropriate command, then wait a couple of seconds. The system will stop the time and count the ticks it manages to simulate. Then it tells me how many ticks there were per second. A good Minecraft server runs on average between 19 and 20 ticks per second; 20 are almost never reached. Every single time during the last month when I ran this check, it told me we ran at over 19, almost 20, ticks per second, which is excellent. Thanks to an advanced optimized server software, Winthier has no problem handling all our players every day. Causes Too many entities This is the only thing that sometimes causes the server to run under average. If players decide that they want animal farms with thousands of cows, pigs, chickens or sheep, the server has to do tons of calculations for each of them. If a player decides to go AFK while next to his monster spawner XP farm, they will collect there with no limit. Entities are particularly tricky when there are many of them close together. When they bump into each other like this, the server has to check for each of them whether it collides with another one. If you are good at math, you will know that the growth of the complexity of this is at least quadratic, which is crazy. Redstone clocks Another, more rare cause of server lag is redstone circuitry that creates frequent pulses, called clocks. If the server has to spend time every tick calculating the new redstone states, which are switching between on and off every time, it is likely that it spends so much time on that that it can't keep up with all the other calculations it has to do, thus creating lag. This is the exact reason why you are not allowed to have them running all the time. And because people don't usually have them around, Winthier does not often lag. Solutions Avoid many entities You can help the server and everyone playing on it by not producing too many entities or not having them loaded all the time. It is rare that one player alone creates lag by having tons of animals in his barn, but if there are 40 players online, 10 of which are at home with 5000 cows in their basements each, things can get out of hand. So if you have to have a huge animal farm, maybe choose a location away from most people so it can stay saved on disk, not loaded and simulated all the time. This also reduces client lag. Try to space your animals or monsters so they don't bump into each other all the time. And you should never wait next to a creature spawner while being AFK, collecting them for too long. At least make sure to kill them regularly, before their numbers reach 300. Everyone on the server will thank your for that much attentiveness. Avoid running redstone clocks If you are good with redstone, you know the uses of redstone clocks. It is okay to build them and use them on occasion, but you can't leave them running all the time, while they are not actively being used by a player. And if an admin or moderator tells you to turn them off, you have to turn them off. When I discover a running redstone clock with no one around, I usually break it and leave a message. This isn't fun but necessary to keep the server running as smoothly as it has been. So be careful. What we do There is a lot of powerful detection software installed on the server, which helps us pinpoint the cause of lag. Almost every time we find it is something that players did, and end up having to remove mobs or redstone circuitry and reminding people not to overdo it. Minecraft is a game with many freedoms. One of those freedoms is is the freedom of players to harm server peformance by means of specific actions in the game. People don't usually do it on purpose, but something player made causing trouble to the server does happen and we have no choice but doing something about it for the sake of all players. Thank you for understanding. Category:General